package com.eastfair.projectcore.dto;

import com.eastfair.annotation.base.SubjectTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * Date:2022/2/24
 * Time:13:45
 *
 * @author zjn
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ObjectFormFieldDetailsVO", description = "表单实体属性类")
public class ObjectFormFieldDetailsDTO implements Serializable {

    private static final long serialVersionUID = -1333222552695166948L;

    /**
     * 包装校验标识
     */
    public interface VerifyAssemble {
    }

    /**
     * 拆包装校验标识
     */
    public interface VerifyDisassemble {
    }

    /**
     * 目标类型
     */
    @ApiModelProperty(value = "目标类型")


    @NotNull(groups = {VerifyAssemble.class}, message = "未知的类型")
    private SubjectTypeEnum targetSubjectType;

    /**
     * 需要转换的实体
     */
    @ApiModelProperty(value = "需要转换的实体")
    @NotNull(groups = {VerifyAssemble.class, VerifyDisassemble.class}, message = "需要转换的实体不能为空")
    private Object obj;

    /**
     * 需要转换的实体
     */
    @ApiModelProperty(value = "实体类名不能为空")
    @NotBlank(groups = {VerifyAssemble.class, VerifyDisassemble.class}, message = "实体类名不能为空")
    private String className;

}
